1. Field of the Invention
Embodiments of the present invention generally relate to live streaming and, more particularly, to a method and apparatus for supporting failover for live streaming video.
2. Description of the Related Art
In content delivery networks that deliver media content to media servers, an encoder receives media content from a source and sends the content in a media stream to one or more packagers. Upon receipt of the media stream, the packager separates the media stream into fragments of a predefined duration, for example, 4 seconds each. All of the packagers receive the same media content and generate the same fragments. The packager also generates a bootstrap file that comprises information regarding the start time of each fragment, the duration of each fragment and the current media time of the stream. The fragments and the bootstrap file are stored in memory. The packagers continue to receive streams of media content for the duration of a program. As streams are received, the packagers generate media fragments and update the bootstrap file with information regarding the new fragments. When a client device is ready to play the program, the client device sends a request to a reverse proxy server for an index file comprising a playlist of media segments. The reverse proxy server selects one of the packagers and forwards the request to the selected packager.
In response to a request for the index file, the packager refers to the bootstrap file and dynamically generates an index file comprising a list of media segments and a location of each media segment. The index file is sent through to the reverse proxy server, which sends the index file on to the client device. The client device then reads the index file and sends a request to the reverse proxy server for a media segment listed in the index file. The reverse proxy server then sends the request to a packager. When a request for the media segment is received by the packager, the packager dynamically converts one or more fragments into the requested media segment. For example, a media segment may comprise ten seconds of content. Each fragment may comprise four seconds of content. As such, the packager creates the requested media segment from multiple fragments. The packager sends the requested media segment to the reverse proxy server, which then sends it to the client device.
Playback of the media content can suffer when a packager is not able to get current media content due to poor connectivity with an encoder or other service interruption, such as when a packager stops working for a period of time. Liveness refers to the timeliness of playback, which suffers when a connection is lost either temporarily or permanently between the encoder and the packager. When the connection is lost, the packager does not receive new media content and continues to send non-current, or stale, index files to the client device. Dropout refers to the loss of a connection for some period of time between the encoder and the packager. When dropout occurs, media content is supplied to the client device, but there is a gap in the content for the period of time the connection between the encoder and the packager was interrupted. Partial content refers to the client device retrieving a media segment that contains fewer seconds of content than a configured duration. For example, the media segment should contain, for example, ten seconds of content, but contains only seven seconds of content.
These three scenarios namely, liveness, dropout, and partial content result in a poor experience for the viewer of the media content. Currently, when liveness occurs, the client device may replay old content that has already been played on the client device. When dropout or partial content occurs, no content is played for the missing time.
Therefore, there is a need for a method and apparatus for improving live streaming video.